package g.beny.manage.action;

import g.beny.framework.web.ActionSupport;
import g.beny.manage.bean.Accountuser;
import g.beny.manage.services.AccountuserService;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Param;

@At("/Accountuser")
@IocBean
public class AccountuserAction extends ActionSupport{
	@Inject
    private AccountuserService  accountuserService;
	
	@At
	public Object list(){
		return accountuserService.list(getCnd());
	}
	
	@At
	public boolean add(@Param("..") Accountuser obj) throws Throwable{
		try {
			return accountuserService.add(obj);
		} catch (Throwable e) {
			e.printStackTrace();
			throw e;
		}
	}
	
	@At
	public boolean delete(@Param("..") Accountuser obj){
		return accountuserService.delete(obj);
	}
	
	@At
	public boolean update(@Param("..") Accountuser obj){
		return accountuserService.update(obj);
	}
}